namespace CSharpPro._0925;

public class Demo
{
    public void TestPrint1()
    {
        int a=Convert.ToInt32(Console.ReadLine());
        bool flag = (a % 4 == 0 && a % 100 != 0) || a %400 == 0;
        if (flag)
        {
            Console.WriteLine($"{a}年是闰年！");
        }
        else
        {
            Console.WriteLine($"{a}年不是闰年！");

        }
    }
    public static void Main()
    {
        
        Demo checker = new Demo();
        
        checker.TestPrint1();
        Console.WriteLine();
        Console.ReadKey();
    }
}



class Travel
{
    static void Test2()
    {
        double originalPrice = 8800;
        
        try
        {
            Console.Write("请输入出行的月份（1-12）：");
            int month = int.Parse(Console.ReadLine());
            
            if (month < 1 || month > 12)
            {
                Console.WriteLine("错误：月份必须在1到12之间！");
                return;
            }
            
            Console.Write("请输入交通方式（航班/动车）：");
            string transport = Console.ReadLine()?.Trim();
            
            if (transport != "航班" && transport != "动车")
            {
                Console.WriteLine("错误：交通方式只能是'航班'或'动车'！");
                return;
            }
            
            double discount = CalculateDiscount(month, transport);
            double finalPrice = originalPrice * discount;
            
            Console.WriteLine($"此旅游行程的价格为：{finalPrice:F2} 元");
        }
        catch (FormatException)
        {
            Console.WriteLine("错误：请输入有效的数字！");
        }
        catch (Exception ex)
        {
            Console.WriteLine($"发生错误：{ex.Message}");
        }
    }
    static double CalculateDiscount(int month, string transport)
    {
        bool isPeakSeason = month >= 5 && month <= 10;
        
        if (isPeakSeason)
        {
            return transport == "航班" ? 0.9 : 0.75;
        }
        else
        {
            return transport == "航班" ? 0.6 : 0.3;
        }
    }
}



 
 